<template>
  <h1>单选组件</h1>
  <el-radio-group v-model="gender">
    <el-radio label="男" value="1"></el-radio>
    <el-radio label="女" value="0"></el-radio>
  </el-radio-group>
  <h4>{{gender}}</h4>

  <hr>
  <el-radio-group v-model="person">
      <el-radio v-for="i in data" :label="i.level" :value="i.value"></el-radio>
  </el-radio-group>
  <h4>{{person}}</h4>
</template>

<script setup>
  import {ref} from "vue";

  const gender=ref('');
  const person=ref('');
  const data=ref([
    {level:'员工',value:'10'},
    {level:'经理',value:'20'},
    {level:'总监',value:'30'},
    {level:'总裁',value:'40'}
  ])
</script>

<style scoped>

</style>